package org.codeart.visitor.example01;

import java.time.LocalDate;

public class Client {

    public static void main(String[] args) {
        Candy candy = new Candy("阿尔卑斯", LocalDate.of(2023, 1, 1), 10);
        Visitor visitor = new DiscountVisitor(LocalDate.of(2023, 7, 20));
        visitor.visit(candy);

        Acceptor[] acceptors = {
                new Candy("大白兔", LocalDate.of(2023, 1, 1), 20),
                new Wine("梦之蓝", LocalDate.of(2020, 1, 10), 5000),
                new Fruit("车厘子", LocalDate.of(2023, 5, 1), 20, 10),
        };

        for (Acceptor acceptor : acceptors) {
            acceptor.accept(visitor);
        }
    }

}
